// sign in:
const {findData,addData,deleData,exitData} = require('../middleware/mysql.js');

module.exports = {
  "POST /signin": async (ctx, next) => {
    var email = ctx.request.body.email || "",
      password = ctx.request.body.password || "";
    if (email === "admin@example.com" && password === "123456") {
      console.log("signin ok!");
      ctx.render("signin-ok.html", {
        title: "Sign In OK",
        name: "Mr Node"
      });
    } else {
      console.log("signin failed!");
      ctx.render("signin-failed.html", {
        title: "Sign In Failed"
      });
    }
  },
  "GET /signin/info":async (ctx, next) => {
    await next();
    ctx.body = {
      aa:1,
      bb:2
    };
  }
};
